﻿
using IdentityModel;
using IdentityModel.Client;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Models.Common;
using Models.Identity;
using Models.JsonResultModel;
using Models.WebClient;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Net.Http.Headers;
using System.Security.Principal;
using UtilsORM;
using UtilsORM.MySqlData;
using ServiceWeb.APIRequest;
using ServiceWeb.DBGateway;
using UtilsBase;
using FileServer.Controllers.API.Common;
using UtilsCache;
using ServiceWeb.WebAdmin;
using UtilsORM.FileServerData;
using FileServer.Common;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
using Microsoft.CodeAnalysis;
using System.IO.Compression;
using SharpCifs.Netbios;
using static NPOI.SS.Formula.PTG.AttrPtg;


namespace SystemController.Controllers.API
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    // [BasicAuthentication]
    public class SystemController : BaseMagerController
    {
        private readonly string _personfileServerDir = UtilAppsettingCache.getSetting("base:personFileServerDir");
        private readonly string _publicfileServerDir = UtilAppsettingCache.getSetting("base:publicFileServerDir");
        public readonly string _CurrentDirectory = System.Environment.CurrentDirectory + "/";

        public RespResultData getPersonFileServerDirSize()
        {
            RespSystemInfo respSystemInfo = new RespSystemInfo();

            string size= new ServiceFile().getDirSumSpaceSize(base.LoginUserInfo.user_id)+" MB";
            string count = new ServiceFile().getFileCount(base.LoginUserInfo.user_id) +" 个";


            respSystemInfo.totalFileSize = size;
            respSystemInfo.totalFileCount = count;
            return RespResult.Sucess(respSystemInfo);
       
        }

    }
}
